package io_exercise;

import java.io.*;

public class CopyDemoBuffered1 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis1=new FileInputStream("K.jpg");
        BufferedInputStream bis1=new BufferedInputStream(fis1);
        FileOutputStream fos1=new FileOutputStream("k_cp1.jpg");
        BufferedOutputStream bos1=new BufferedOutputStream(fos1);
        long start1=System.currentTimeMillis();
        int d1;
        while ((d1=bis1.read())!=-1){
            bos1.write(d1);
        }
        long end1=System.currentTimeMillis();
        System.out.println("复制完毕，耗时:"+(end1-start1)+"ms");
        bis1.close();
        bos1.close();
    }
}
